package com.amoyhong.hongWhether;

import android.content.Intent;

import com.amoyhong.hongWhether.native_network.CityInfoNetworkManager;
import com.amoyhong.hongWhether.service.LocateService;
import com.amoyhong.hongWhether.utils.PermissionChecker;
import com.orhanobut.logger.Logger;


/**
 * Created by Administrator on 2016/1/9.
 */
public class MyApplication extends com.activeandroid.app.Application {

    private static MyApplication instance;

    @Override
    public void onCreate() {
        super.onCreate();
        Logger.init("Hong");
        instance = this;
        CityInfoNetworkManager.updateLatestCityInfo();

        if (PermissionChecker.hasLocatePermission()) {
            startService(new Intent(this, LocateService.class));
        }
        Logger.d("MyApplication on create");
    }

    public static MyApplication getInstance() {
        return instance;
    }
}
